import Mock from 'mockjs2'
import {
  builder
} from '../util'

const data = {
  accessToken: 'accessToken',
  refreshToken: 'accessToken',
  nickname: 'nickname',
  avatar: 'https://portrait.gitee.com/uploads/avatars/user/612/1836248_evildog_1588216550.png!avatar200'
}

const token = (options) => {
  return builder(data)
}

const permissions = (options) => {
  return builder({
    menu: ['menu1'],
    permission: ['admin']
  })
}

const logout = () => {
  const data = {
  }

  return builder(data)
}

Mock.mock(/\/auth\/token/, 'post', token)
Mock.mock(/\/system\/permission/, 'get', permissions)
Mock.mock(/\/system\/logout/, 'post', logout)
